package com.cpi.cornpp.creditlinebalance.form;

import java.util.ArrayList;
import java.util.List;

import org.apache.struts.validator.ValidatorForm;

import com.cpi.cornpp.creditline.view.CreditLineView;

public class CreditLineBalanceForm extends ValidatorForm {

	/**
	 * 
	 */
	private static final long serialVersionUID = -4559289119644563201L;
	
	private CreditLineView view;
	
	private List listPeriods;
	
	private List subListPeriods;
	
	private List balances;
	
	private List balancesApplied;
	
	private int initPeriodId;
	
	private int finishPeriodId;	
	
	private int subInitPeriodId;
	
	private int subFinishPeriodId;
	
	private double  amount = 0.0;
	
	private boolean pre = false;
	
		
	public CreditLineBalanceForm() {
		view = new CreditLineView();
		balances = new ArrayList();
		listPeriods = new ArrayList();
		subListPeriods = new ArrayList();
	}

	public CreditLineView getView() {
		return view;
	}

	public void setView(CreditLineView view) {
		this.view = view;
	}


	public int getFinishPeriodId() {
		return finishPeriodId;
	}

	public void setFinishPeriodId(int finishPeriodId) {
		this.finishPeriodId = finishPeriodId;
	}

	public int getInitPeriodId() {
		return initPeriodId;
	}

	public void setInitPeriodId(int initPeriodId) {
		this.initPeriodId = initPeriodId;
	}
	

	public List getListPeriods() {
		return listPeriods;
	}

	public void setListPeriods(List periods) {
		this.listPeriods = periods;
	}
	
	public List getSubListPeriods() {
		return subListPeriods;
	}

	public void setSubListPeriods(List subPeriods) {
		this.subListPeriods = subPeriods;
	}

	public List getBalances() {
		return balances;
	}

	public void setBalances(List balancePeriods) {
		this.balances = balancePeriods;
	}

	public int getSubInitPeriodId() {
		return subInitPeriodId;
	}

	public void setSubInitPeriodId(int subInitPeriodId) {
		this.subInitPeriodId = subInitPeriodId;
	}

	public int getSubFinishPeriodId() {
		return subFinishPeriodId;
	}

	public void setSubFinishPeriodId(int subFinishPeriodId) {
		this.subFinishPeriodId = subFinishPeriodId;
	}

	public double getAmount() {
		return amount;
	}

	public void setAmount(double amount) {
		this.amount = amount;
	}

	public boolean isPre() {
		return pre;
	}

	public void setPre(boolean pre) {
		this.pre = pre;
	}

	public int getListPeriodsSize(){
		if(listPeriods!=null){
			return listPeriods.size();
		}
		return 1;
	}

	public List getBalancesApplied() {
		return balancesApplied;
	}

	public void setBalancesApplied(List balancesApplied) {
		this.balancesApplied = balancesApplied;
	}

	
}
